<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('basic');
    $return['item']=$item;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$shouhoufees=array();
	$xueli_type=$this->xueli_type;
	foreach($xueli_type as $k=>$title){
		$shouhoufees[]=array('type'=>'unitstring','unit'=>'元','title'=>'['.$title.']售后成本费','name'=>'shouhoufee'.$k);
	}
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'系统设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本参数',
				'list'=>array(
					array('type'=>'string','title'=>'系统名称','name'=>'title'),
					array('type'=>'string','title'=>'系统描述','name'=>'desc'),
					array('type'=>'image','title'=>'系统logo','name'=>'logo'),
					array('type'=>'title','title'=>'客户释放到公海规则'),
					array('type'=>'unitstring','unit'=>'天','title'=>'销售员N天未更新','name'=>'sf_day','help'=>'N天内未跟进，客户会释放到公海（部分客户不做处理）'),
					array('type'=>'unitstring','unit'=>'天','title'=>'电销N天未更新','name'=>'sf_dianday','help'=>'N天内未跟进，客户会释放到公海（部分客户不做处理）'),
					array('type'=>'switch','title'=>'门店不让添加员工','name'=>'store_nowork'),
					array('type'=>'image','title'=>'登录背景图片','name'=>'bgimg','help'=>'尺寸1920*1080'),
					array('type'=>'string','title'=>'登录页英文','name'=>'oneendesc','help'=>'默认：Education training CRM'),
					array('type'=>'string','title'=>'品牌英文','name'=>'pinpai','help'=>'默认：PINGPAI'),
					array('type'=>'string','title'=>'ICP','name'=>'icp'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
				'title'=>'售后成本',
				'list'=>$shouhoufees,
			),
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$item=$this->plugin_setting('basic',$postdata);
	exi('设置成功');
}
?>